//
//  ShellGrabOrderViewController.m
//  ShellWallert
//
//  Created by lvzhao on 2019/9/25.
//  Copyright © 2019年 吕VV. All rights reserved.
//

#import "ShellGrabOrderViewController.h"
#import "ShellGrabOrderView.h"
#import "ShellGrabOrderViewModel.h"


@interface ShellGrabOrderViewController ()
@property (nonatomic,strong) ShellGrabOrderView *orderView;

@property (nonatomic,strong) ShellGrabOrderViewModel *viewModel;
@end

@implementation ShellGrabOrderViewController


- (instancetype)init
{
    self = [super init];
    if (self) {
        @weakify(self);
        [[[NSNotificationCenter defaultCenter] rac_addObserverForName:k_APPLanguageWillChangeNotificationName object:nil] subscribeNext:^(NSNotification * _Nullable x) {
            @strongify(self);
            self.title = LZLocalizedString(@"接单");
        }];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = LZLocalizedString(@"接单");
    // Do any additional setup after loading the view.
    [self setupUI];
 
    [self.viewModel getStatus];
    
    
    
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.viewModel getSettlData];
    [self.viewModel getOrder:YES];

}


#pragma mark - setupUI
- (void)setupUI{
    [self.view addSubview:self.orderView];
    [self.orderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

#pragma mark - actions

#pragma mark - custool

#pragma mark - get && set
- (ShellGrabOrderView *)orderView{
    
    if(!_orderView){
        _orderView = [[ShellGrabOrderView alloc] initViewModel:self.viewModel];
    }
    return _orderView;
}

- (ShellGrabOrderViewModel *)viewModel{
    if(!_viewModel){
        _viewModel = [[ShellGrabOrderViewModel alloc] init];
    }
    return _viewModel;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
